package com.woniu.admin.config;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha;
import cn.hutool.core.lang.Snowflake;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;

@Configuration
public class MyConfig {

    //验证码
//    @Bean
//    public LineCaptcha lineCaptcha() {
//        return CaptchaUtil.createLineCaptcha(210, 90);
//    }

    @Bean
    public LineCaptcha lineCaptcha() {
        // 这里的参数根据你的需求进行调整
        return new LineCaptcha(210, 90, 5, 15);
    }

    //雪花算法
    @Bean
    public Snowflake snowflake() {
        return new Snowflake(1, 1);
    }

    //hashmap
    @Bean
    public HashMap<String, String> hashMap() {
        return new HashMap<>(16);
    }
}